/*
* Copyright 2024 NXP
* NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
* comply with and are bound by, such license terms.  If you do not agree to be bound by the applicable license
* terms, then you may not retain, install, activate or otherwise use the software.
*/

#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "widgets_init.h"
#include "custom.h"



lv_calendar_date_t main_calendar_today;
lv_calendar_date_t main_calendar_highlihted_days[1];
void setup_scr_main(lv_ui *ui)
{
    //Write codes main
    ui->main = lv_obj_create(NULL);
    lv_obj_set_size(ui->main, 480, 480);
    lv_obj_set_scrollbar_mode(ui->main, LV_SCROLLBAR_MODE_OFF);

    //Write style for main, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->main, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes main_imgbtn_settings
    ui->main_imgbtn_settings = lv_imgbtn_create(ui->main);
    lv_obj_add_flag(ui->main_imgbtn_settings, LV_OBJ_FLAG_CHECKABLE);
    lv_imgbtn_set_src(ui->main_imgbtn_settings, LV_IMGBTN_STATE_RELEASED, NULL, &_icon_settings_alpha_50x50, NULL);
    ui->main_imgbtn_settings_label = lv_label_create(ui->main_imgbtn_settings);
    lv_label_set_text(ui->main_imgbtn_settings_label, "");
    lv_label_set_long_mode(ui->main_imgbtn_settings_label, LV_LABEL_LONG_WRAP);
    lv_obj_align(ui->main_imgbtn_settings_label, LV_ALIGN_CENTER, 0, 0);
    lv_obj_set_style_pad_all(ui->main_imgbtn_settings, 0, LV_STATE_DEFAULT);
    lv_obj_set_pos(ui->main_imgbtn_settings, 0, 430);
    lv_obj_set_size(ui->main_imgbtn_settings, 50, 50);

    //Write style for main_imgbtn_settings, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_text_color(ui->main_imgbtn_settings, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->main_imgbtn_settings, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->main_imgbtn_settings, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->main_imgbtn_settings, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->main_imgbtn_settings, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_clip_corner(ui->main_imgbtn_settings, true, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->main_imgbtn_settings, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style for main_imgbtn_settings, Part: LV_PART_MAIN, State: LV_STATE_PRESSED.
    lv_obj_set_style_img_recolor_opa(ui->main_imgbtn_settings, 0, LV_PART_MAIN|LV_STATE_PRESSED);
    lv_obj_set_style_img_opa(ui->main_imgbtn_settings, 255, LV_PART_MAIN|LV_STATE_PRESSED);
    lv_obj_set_style_text_color(ui->main_imgbtn_settings, lv_color_hex(0xFF33FF), LV_PART_MAIN|LV_STATE_PRESSED);
    lv_obj_set_style_text_font(ui->main_imgbtn_settings, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_PRESSED);
    lv_obj_set_style_text_opa(ui->main_imgbtn_settings, 255, LV_PART_MAIN|LV_STATE_PRESSED);
    lv_obj_set_style_shadow_width(ui->main_imgbtn_settings, 0, LV_PART_MAIN|LV_STATE_PRESSED);

    //Write style for main_imgbtn_settings, Part: LV_PART_MAIN, State: LV_STATE_CHECKED.
    lv_obj_set_style_img_recolor_opa(ui->main_imgbtn_settings, 0, LV_PART_MAIN|LV_STATE_CHECKED);
    lv_obj_set_style_img_opa(ui->main_imgbtn_settings, 255, LV_PART_MAIN|LV_STATE_CHECKED);
    lv_obj_set_style_text_color(ui->main_imgbtn_settings, lv_color_hex(0xFF33FF), LV_PART_MAIN|LV_STATE_CHECKED);
    lv_obj_set_style_text_font(ui->main_imgbtn_settings, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_CHECKED);
    lv_obj_set_style_text_opa(ui->main_imgbtn_settings, 255, LV_PART_MAIN|LV_STATE_CHECKED);
    lv_obj_set_style_shadow_width(ui->main_imgbtn_settings, 0, LV_PART_MAIN|LV_STATE_CHECKED);

    //Write style for main_imgbtn_settings, Part: LV_PART_MAIN, State: LV_IMGBTN_STATE_RELEASED.
    lv_obj_set_style_img_recolor_opa(ui->main_imgbtn_settings, 0, LV_PART_MAIN|LV_IMGBTN_STATE_RELEASED);
    lv_obj_set_style_img_opa(ui->main_imgbtn_settings, 255, LV_PART_MAIN|LV_IMGBTN_STATE_RELEASED);
#if 0
    //Write codes main_calendar
    ui->main_calendar = lv_calendar_create(ui->main);
    main_calendar_today.year = 2024;
    main_calendar_today.month = 10;
    main_calendar_today.day = 15;
    lv_calendar_set_today_date(ui->main_calendar, main_calendar_today.year, main_calendar_today.month, main_calendar_today.day);
    lv_calendar_set_showed_date(ui->main_calendar, main_calendar_today.year, main_calendar_today.month);
    main_calendar_highlihted_days[0].year = 2024;
    main_calendar_highlihted_days[0].month = 10;
    main_calendar_highlihted_days[0].day = 16;
    lv_calendar_set_highlighted_dates(ui->main_calendar, main_calendar_highlihted_days, 1);
    lv_obj_t *main_calendar_header = lv_calendar_header_arrow_create(ui->main_calendar);
    lv_calendar_t *main_calendar = (lv_calendar_t *)ui->main_calendar;
    lv_obj_add_event_cb(main_calendar->btnm, main_calendar_draw_part_begin_event_cb, LV_EVENT_DRAW_PART_BEGIN, NULL);
    lv_obj_add_event_cb(ui->main_calendar, main_calendar_event_handler, LV_EVENT_ALL, NULL);
    lv_obj_set_pos(ui->main_calendar, 0, 0);
    lv_obj_set_size(ui->main_calendar, 280, 210);

    //Write style state: LV_STATE_DEFAULT for &style_main_calendar_main_main_default
    static lv_style_t style_main_calendar_main_main_default;
    ui_init_style(&style_main_calendar_main_main_default);

    lv_style_set_border_width(&style_main_calendar_main_main_default, 1);
    lv_style_set_border_opa(&style_main_calendar_main_main_default, 255);
    lv_style_set_border_color(&style_main_calendar_main_main_default, lv_color_hex(0xc0c0c0));
    lv_style_set_border_side(&style_main_calendar_main_main_default, LV_BORDER_SIDE_FULL);
    lv_style_set_bg_opa(&style_main_calendar_main_main_default, 255);
    lv_style_set_bg_color(&style_main_calendar_main_main_default, lv_color_hex(0xffffff));
    lv_style_set_bg_grad_dir(&style_main_calendar_main_main_default, LV_GRAD_DIR_NONE);
    lv_style_set_shadow_width(&style_main_calendar_main_main_default, 0);
    lv_style_set_radius(&style_main_calendar_main_main_default, 0);
    lv_obj_add_style(ui->main_calendar, &style_main_calendar_main_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style state: LV_STATE_DEFAULT for &style_main_calendar_extra_header_main_default
    static lv_style_t style_main_calendar_extra_header_main_default;
    ui_init_style(&style_main_calendar_extra_header_main_default);

    lv_style_set_text_color(&style_main_calendar_extra_header_main_default, lv_color_hex(0xffffff));
    lv_style_set_text_font(&style_main_calendar_extra_header_main_default, &lv_font_montserratMedium_12);
    lv_style_set_text_opa(&style_main_calendar_extra_header_main_default, 255);
    lv_style_set_bg_opa(&style_main_calendar_extra_header_main_default, 255);
    lv_style_set_bg_color(&style_main_calendar_extra_header_main_default, lv_color_hex(0x2195f6));
    lv_style_set_bg_grad_dir(&style_main_calendar_extra_header_main_default, LV_GRAD_DIR_NONE);
    lv_obj_add_style(main_calendar_header, &style_main_calendar_extra_header_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style state: LV_STATE_DEFAULT for &style_main_calendar_main_items_default
    static lv_style_t style_main_calendar_main_items_default;
    ui_init_style(&style_main_calendar_main_items_default);

    lv_style_set_bg_opa(&style_main_calendar_main_items_default, 0);
    lv_style_set_border_width(&style_main_calendar_main_items_default, 1);
    lv_style_set_border_opa(&style_main_calendar_main_items_default, 255);
    lv_style_set_border_color(&style_main_calendar_main_items_default, lv_color_hex(0xc0c0c0));
    lv_style_set_border_side(&style_main_calendar_main_items_default, LV_BORDER_SIDE_FULL);
    lv_style_set_text_color(&style_main_calendar_main_items_default, lv_color_hex(0x0D3055));
    lv_style_set_text_font(&style_main_calendar_main_items_default, &lv_font_montserratMedium_12);
    lv_style_set_text_opa(&style_main_calendar_main_items_default, 255);
    lv_obj_add_style(lv_calendar_get_btnmatrix(ui->main_calendar), &style_main_calendar_main_items_default, LV_PART_ITEMS|LV_STATE_DEFAULT);
#endif

    //Write codes main_list_devices
    ui->main_list_devices = lv_list_create(ui->main);
    // ui->main_list_devices_item0 = lv_list_add_btn(ui->main_list_devices, LV_SYMBOL_OK, "");
    lv_obj_set_pos(ui->main_list_devices, 240, 235);
    lv_obj_set_size(ui->main_list_devices, 240, 170);
    lv_obj_set_scrollbar_mode(ui->main_list_devices, LV_SCROLLBAR_MODE_OFF);

    //Write style state: LV_STATE_DEFAULT for &style_main_list_devices_main_main_default
    static lv_style_t style_main_list_devices_main_main_default;
    ui_init_style(&style_main_list_devices_main_main_default);

    lv_style_set_pad_top(&style_main_list_devices_main_main_default, 5);
    lv_style_set_pad_left(&style_main_list_devices_main_main_default, 5);
    lv_style_set_pad_right(&style_main_list_devices_main_main_default, 5);
    lv_style_set_pad_bottom(&style_main_list_devices_main_main_default, 5);
    lv_style_set_bg_opa(&style_main_list_devices_main_main_default, 255);
    lv_style_set_bg_color(&style_main_list_devices_main_main_default, lv_color_hex(0xffffff));
    lv_style_set_bg_grad_dir(&style_main_list_devices_main_main_default, LV_GRAD_DIR_NONE);
    lv_style_set_border_width(&style_main_list_devices_main_main_default, 1);
    lv_style_set_border_opa(&style_main_list_devices_main_main_default, 255);
    lv_style_set_border_color(&style_main_list_devices_main_main_default, lv_color_hex(0xe1e6ee));
    lv_style_set_border_side(&style_main_list_devices_main_main_default, LV_BORDER_SIDE_FULL);
    lv_style_set_radius(&style_main_list_devices_main_main_default, 3);
    lv_style_set_shadow_width(&style_main_list_devices_main_main_default, 0);
    lv_obj_add_style(ui->main_list_devices, &style_main_list_devices_main_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style state: LV_STATE_DEFAULT for &style_main_list_devices_main_scrollbar_default
    static lv_style_t style_main_list_devices_main_scrollbar_default;
    ui_init_style(&style_main_list_devices_main_scrollbar_default);

    lv_style_set_radius(&style_main_list_devices_main_scrollbar_default, 3);
    lv_style_set_bg_opa(&style_main_list_devices_main_scrollbar_default, 255);
    lv_style_set_bg_color(&style_main_list_devices_main_scrollbar_default, lv_color_hex(0xffffff));
    lv_style_set_bg_grad_dir(&style_main_list_devices_main_scrollbar_default, LV_GRAD_DIR_NONE);
    lv_obj_add_style(ui->main_list_devices, &style_main_list_devices_main_scrollbar_default, LV_PART_SCROLLBAR|LV_STATE_DEFAULT);

    //Write style state: LV_STATE_DEFAULT for &style_main_list_devices_extra_btns_main_default
    static lv_style_t style_main_list_devices_extra_btns_main_default;
    ui_init_style(&style_main_list_devices_extra_btns_main_default);

    lv_style_set_pad_top(&style_main_list_devices_extra_btns_main_default, 5);
    lv_style_set_pad_left(&style_main_list_devices_extra_btns_main_default, 5);
    lv_style_set_pad_right(&style_main_list_devices_extra_btns_main_default, 5);
    lv_style_set_pad_bottom(&style_main_list_devices_extra_btns_main_default, 5);
    lv_style_set_border_width(&style_main_list_devices_extra_btns_main_default, 0);
    lv_style_set_text_color(&style_main_list_devices_extra_btns_main_default, lv_color_hex(0x0D3055));
    lv_style_set_text_font(&style_main_list_devices_extra_btns_main_default, &lv_font_montserratMedium_12);
    lv_style_set_text_opa(&style_main_list_devices_extra_btns_main_default, 255);
    lv_style_set_radius(&style_main_list_devices_extra_btns_main_default, 3);
    lv_style_set_bg_opa(&style_main_list_devices_extra_btns_main_default, 255);
    lv_style_set_bg_color(&style_main_list_devices_extra_btns_main_default, lv_color_hex(0xffffff));
    lv_style_set_bg_grad_dir(&style_main_list_devices_extra_btns_main_default, LV_GRAD_DIR_NONE);
    ui->main_list_devices_item_style = &style_main_list_devices_extra_btns_main_default;
    ui->main_list_devices_selected_item = NULL;
    // lv_obj_add_style(ui->main_list_devices_item0, &style_main_list_devices_extra_btns_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style state: LV_STATE_DEFAULT for &style_main_list_devices_extra_texts_main_default
    static lv_style_t style_main_list_devices_extra_texts_main_default;
    ui_init_style(&style_main_list_devices_extra_texts_main_default);

    lv_style_set_pad_top(&style_main_list_devices_extra_texts_main_default, 5);
    lv_style_set_pad_left(&style_main_list_devices_extra_texts_main_default, 5);
    lv_style_set_pad_right(&style_main_list_devices_extra_texts_main_default, 5);
    lv_style_set_pad_bottom(&style_main_list_devices_extra_texts_main_default, 5);
    lv_style_set_border_width(&style_main_list_devices_extra_texts_main_default, 0);
    lv_style_set_text_color(&style_main_list_devices_extra_texts_main_default, lv_color_hex(0x0D3055));
    lv_style_set_text_font(&style_main_list_devices_extra_texts_main_default, &lv_font_montserratMedium_12);
    lv_style_set_text_opa(&style_main_list_devices_extra_texts_main_default, 255);
    lv_style_set_radius(&style_main_list_devices_extra_texts_main_default, 3);
    lv_style_set_transform_width(&style_main_list_devices_extra_texts_main_default, 0);
    lv_style_set_bg_opa(&style_main_list_devices_extra_texts_main_default, 255);
    lv_style_set_bg_color(&style_main_list_devices_extra_texts_main_default, lv_color_hex(0xffffff));
    lv_style_set_bg_grad_dir(&style_main_list_devices_extra_texts_main_default, LV_GRAD_DIR_NONE);

    //Write codes main_sw_led
    ui->main_sw_led = lv_switch_create(ui->main);
    lv_obj_set_pos(ui->main_sw_led, 0, 365);
    lv_obj_set_size(ui->main_sw_led, 240, 40);

    //Write style for main_sw_led, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->main_sw_led, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->main_sw_led, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->main_sw_led, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(ui->main_sw_led, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_opa(ui->main_sw_led, 153, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_color(ui->main_sw_led, lv_color_hex(0x00bdff), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_side(ui->main_sw_led, LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->main_sw_led, 10, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->main_sw_led, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style for main_sw_led, Part: LV_PART_INDICATOR, State: LV_STATE_CHECKED.
    lv_obj_set_style_bg_opa(ui->main_sw_led, 223, LV_PART_INDICATOR|LV_STATE_CHECKED);
    lv_obj_set_style_bg_color(ui->main_sw_led, lv_color_hex(0x13359a), LV_PART_INDICATOR|LV_STATE_CHECKED);
    lv_obj_set_style_bg_grad_dir(ui->main_sw_led, LV_GRAD_DIR_HOR, LV_PART_INDICATOR|LV_STATE_CHECKED);
    lv_obj_set_style_bg_grad_color(ui->main_sw_led, lv_color_hex(0x2195f6), LV_PART_INDICATOR|LV_STATE_CHECKED);
    lv_obj_set_style_bg_main_stop(ui->main_sw_led, 0, LV_PART_INDICATOR|LV_STATE_CHECKED);
    lv_obj_set_style_bg_grad_stop(ui->main_sw_led, 0, LV_PART_INDICATOR|LV_STATE_CHECKED);
    lv_obj_set_style_border_width(ui->main_sw_led, 0, LV_PART_INDICATOR|LV_STATE_CHECKED);

    //Write style for main_sw_led, Part: LV_PART_KNOB, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->main_sw_led, 255, LV_PART_KNOB|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->main_sw_led, lv_color_hex(0xffffff), LV_PART_KNOB|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->main_sw_led, LV_GRAD_DIR_NONE, LV_PART_KNOB|LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(ui->main_sw_led, 0, LV_PART_KNOB|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->main_sw_led, 10, LV_PART_KNOB|LV_STATE_DEFAULT);

    //Write codes main_tabview_dev
    ui->main_tabview_dev = lv_tabview_create(ui->main, LV_DIR_TOP, 0);
    lv_obj_set_pos(ui->main_tabview_dev, 0, 235);
    lv_obj_set_size(ui->main_tabview_dev, 240, 125);
    lv_obj_set_scrollbar_mode(ui->main_tabview_dev, LV_SCROLLBAR_MODE_OFF);

    //Write style for main_tabview_dev, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->main_tabview_dev, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->main_tabview_dev, lv_color_hex(0xeaeff3), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->main_tabview_dev, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->main_tabview_dev, lv_color_hex(0x4d4d4d), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->main_tabview_dev, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->main_tabview_dev, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_letter_space(ui->main_tabview_dev, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_line_space(ui->main_tabview_dev, 16, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(ui->main_tabview_dev, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->main_tabview_dev, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->main_tabview_dev, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style state: LV_STATE_DEFAULT for &style_main_tabview_dev_extra_btnm_main_default
    static lv_style_t style_main_tabview_dev_extra_btnm_main_default;
    ui_init_style(&style_main_tabview_dev_extra_btnm_main_default);

    lv_style_set_bg_opa(&style_main_tabview_dev_extra_btnm_main_default, 255);
    lv_style_set_bg_color(&style_main_tabview_dev_extra_btnm_main_default, lv_color_hex(0xffffff));
    lv_style_set_bg_grad_dir(&style_main_tabview_dev_extra_btnm_main_default, LV_GRAD_DIR_NONE);
    lv_style_set_border_width(&style_main_tabview_dev_extra_btnm_main_default, 0);
    lv_style_set_radius(&style_main_tabview_dev_extra_btnm_main_default, 0);
    lv_obj_add_style(lv_tabview_get_tab_btns(ui->main_tabview_dev), &style_main_tabview_dev_extra_btnm_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style state: LV_STATE_DEFAULT for &style_main_tabview_dev_extra_btnm_items_default
    static lv_style_t style_main_tabview_dev_extra_btnm_items_default;
    ui_init_style(&style_main_tabview_dev_extra_btnm_items_default);

    lv_style_set_text_color(&style_main_tabview_dev_extra_btnm_items_default, lv_color_hex(0x4d4d4d));
    lv_style_set_text_font(&style_main_tabview_dev_extra_btnm_items_default, &lv_font_montserratMedium_12);
    lv_style_set_text_opa(&style_main_tabview_dev_extra_btnm_items_default, 255);
    lv_obj_add_style(lv_tabview_get_tab_btns(ui->main_tabview_dev), &style_main_tabview_dev_extra_btnm_items_default, LV_PART_ITEMS|LV_STATE_DEFAULT);

    //Write style state: LV_STATE_CHECKED for &style_main_tabview_dev_extra_btnm_items_checked
    static lv_style_t style_main_tabview_dev_extra_btnm_items_checked;
    ui_init_style(&style_main_tabview_dev_extra_btnm_items_checked);

    lv_style_set_text_color(&style_main_tabview_dev_extra_btnm_items_checked, lv_color_hex(0x2195f6));
    lv_style_set_text_font(&style_main_tabview_dev_extra_btnm_items_checked, &lv_font_montserratMedium_12);
    lv_style_set_text_opa(&style_main_tabview_dev_extra_btnm_items_checked, 255);
    lv_style_set_border_width(&style_main_tabview_dev_extra_btnm_items_checked, 4);
    lv_style_set_border_opa(&style_main_tabview_dev_extra_btnm_items_checked, 255);
    lv_style_set_border_color(&style_main_tabview_dev_extra_btnm_items_checked, lv_color_hex(0x2195f6));
    lv_style_set_border_side(&style_main_tabview_dev_extra_btnm_items_checked, LV_BORDER_SIDE_BOTTOM);
    lv_style_set_radius(&style_main_tabview_dev_extra_btnm_items_checked, 0);
    lv_style_set_bg_opa(&style_main_tabview_dev_extra_btnm_items_checked, 60);
    lv_style_set_bg_color(&style_main_tabview_dev_extra_btnm_items_checked, lv_color_hex(0x2195f6));
    lv_style_set_bg_grad_dir(&style_main_tabview_dev_extra_btnm_items_checked, LV_GRAD_DIR_NONE);
    lv_obj_add_style(lv_tabview_get_tab_btns(ui->main_tabview_dev), &style_main_tabview_dev_extra_btnm_items_checked, LV_PART_ITEMS|LV_STATE_CHECKED);

    //Write codes tv_humi_temp_led
    ui->main_tabview_dev_tab_1 = lv_tabview_add_tab(ui->main_tabview_dev,"tv_humi_temp_led");
    lv_obj_t * main_tabview_dev_tab_1_label = lv_label_create(ui->main_tabview_dev_tab_1);
    lv_label_set_text(main_tabview_dev_tab_1_label, "");

    //Write codes main_img_humi
    ui->main_img_humi = lv_img_create(ui->main_tabview_dev_tab_1);
    lv_obj_add_flag(ui->main_img_humi, LV_OBJ_FLAG_CLICKABLE);
    lv_img_set_src(ui->main_img_humi, &_icon_humidity_alpha_32x32);
    lv_img_set_pivot(ui->main_img_humi, 50,50);
    lv_img_set_angle(ui->main_img_humi, 0);
    lv_obj_set_pos(ui->main_img_humi, 40, 10);
    lv_obj_set_size(ui->main_img_humi, 32, 32);

    //Write style for main_img_humi, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_img_recolor_opa(ui->main_img_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_img_opa(ui->main_img_humi, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->main_img_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_clip_corner(ui->main_img_humi, true, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes main_img_temp
    ui->main_img_temp = lv_img_create(ui->main_tabview_dev_tab_1);
    lv_obj_add_flag(ui->main_img_temp, LV_OBJ_FLAG_CLICKABLE);
    lv_img_set_src(ui->main_img_temp, &_icon_temperature_alpha_32x32);
    lv_img_set_pivot(ui->main_img_temp, 50,50);
    lv_img_set_angle(ui->main_img_temp, 0);
    lv_obj_set_pos(ui->main_img_temp, 40, 45);
    lv_obj_set_size(ui->main_img_temp, 32, 32);

    //Write style for main_img_temp, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_img_recolor_opa(ui->main_img_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_img_opa(ui->main_img_temp, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->main_img_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_clip_corner(ui->main_img_temp, true, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes main_label_temp
    ui->main_label_temp = lv_label_create(ui->main_tabview_dev_tab_1);
    lv_label_set_text(ui->main_label_temp, "--");
    lv_label_set_long_mode(ui->main_label_temp, LV_LABEL_LONG_WRAP);
    lv_obj_set_pos(ui->main_label_temp, 90, 45);
    lv_obj_set_size(ui->main_label_temp, 100, 32);

    //Write style for main_label_temp, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_border_width(ui->main_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->main_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->main_label_temp, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->main_label_temp, &lv_font_montserratMedium_32, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->main_label_temp, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_letter_space(ui->main_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_line_space(ui->main_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->main_label_temp, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui->main_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(ui->main_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(ui->main_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(ui->main_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(ui->main_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->main_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes main_label_humi
    ui->main_label_humi = lv_label_create(ui->main_tabview_dev_tab_1);
    lv_label_set_text(ui->main_label_humi, "--");
    lv_label_set_long_mode(ui->main_label_humi, LV_LABEL_LONG_WRAP);
    lv_obj_set_pos(ui->main_label_humi, 91, 10);
    lv_obj_set_size(ui->main_label_humi, 100, 32);

    //Write style for main_label_humi, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_border_width(ui->main_label_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->main_label_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->main_label_humi, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->main_label_humi, &lv_font_montserratMedium_32, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->main_label_humi, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_letter_space(ui->main_label_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_line_space(ui->main_label_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->main_label_humi, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui->main_label_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(ui->main_label_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(ui->main_label_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(ui->main_label_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(ui->main_label_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->main_label_humi, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes tv_led
    ui->main_tabview_dev_tab_2 = lv_tabview_add_tab(ui->main_tabview_dev,"tv_led");
    lv_obj_t * main_tabview_dev_tab_2_label = lv_label_create(ui->main_tabview_dev_tab_2);
    lv_label_set_text(main_tabview_dev_tab_2_label, "");

    //Write codes main_led
    ui->main_led = lv_led_create(ui->main_tabview_dev_tab_2);
    lv_led_set_brightness(ui->main_led, 255);
    lv_led_set_color(ui->main_led, lv_color_hex(0x00a1b5));
    lv_obj_set_pos(ui->main_led, 77, 19);
    lv_obj_set_size(ui->main_led, 40, 40);

    //Write codes main_label_time
    ui->main_label_time = lv_label_create(ui->main);
    lv_label_set_text(ui->main_label_time, "18:50\n33");
    lv_label_set_long_mode(ui->main_label_time, LV_LABEL_LONG_WRAP);
    lv_obj_set_pos(ui->main_label_time, 165, 80);
    lv_obj_set_size(ui->main_label_time, 150, 64);

    //Write style for main_label_time, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_border_width(ui->main_label_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->main_label_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->main_label_time, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->main_label_time, &lv_font_montserratMedium_32, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->main_label_time, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_letter_space(ui->main_label_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_line_space(ui->main_label_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->main_label_time, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui->main_label_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(ui->main_label_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(ui->main_label_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(ui->main_label_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(ui->main_label_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->main_label_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //The custom code of main.


    //Update current screen layout.
    lv_obj_update_layout(ui->main);

    //Init events for screen.
    events_init_main(ui);
}
